home *** CD-ROM | disk | FTP | other *** search
- Path: mydata.se!janm
- From: janm@mydata.se (Jan Mattsson)
- Newsgroups: comp.lang.c++
- Subject: Re: Coding Standards
- Date: 16 Mar 96 11:44:19 GMT
- Organization: MYDATA automation AB
- Distribution: world
- Message-ID: <janm.826976659@mydata.se>
- References: <4hj8ek$elu@sam.inforamp.net> <4hktar$5o2@galaxy.ucr.edu> <4hmqol$97j@abacus.abasoft.co.uk> <4hsg8r$pmm@sam.inforamp.net> <4i9o6j$p4l@daisy.pgh.wec.com> <4idskb$pc1@sam.inforamp.net>
- Reply-To: janm@mydata.se
- NNTP-Posting-Host: cray2b.mydata.se
- Organisation: None
- X-Newsreader: NN version 6.5.0 #1 (NOV)
-
- rmorin@inforamp.net (Randy Charles Morin) writes:
-
- > -do not use the /* */ comment, except when commenting out entire
- >sections of code.
- > /* */ are the ANSI standard comment.
-
- As you may or may not know, there is no ANSI standard yet.
- This is what the draft standard says on the subject of comments:
-
- 1 The characters /* start a comment, which terminates with the charac-
- ters */. These comments do not nest. The characters // start a com-
- ment, which terminates with the next new-line character. If there is a
- form-feed or a vertical-tab character in such a comment, only white-
- space characters shall appear between it and the new-line that termi-
- nates the comment; no diagnostic is required. The comment characters
- //, /*, and */ have no special meaning within a // comment and are
- treated just like other characters. Similarly, the comment characters
- // and /* have no special meaning within a /* comment.
-
- Satisfied?
- How about actually reading the bl**dy standard before you
- start telling us what's ANSI and what's not?
-
-
- > -a class which can be instantiated with a "new" must have a copy
- >constructor, a destructor and an assignment operator definition.
- > Most compilers (if not all) supply default copy construtors. Unless
- >you think your class may have copy behavior problems, then writing copy
- >constructors is redundant. When you have 100+ classes to write and where the
- >average copy constructor has 50 lines, you would need 100 hours to write the
- >additional robustness (or cumbersomeness).
-
- If your average class has 50 attributes you need to work on your design.
- Even if that is the case, I fail to see how it can take an hour to type
- 50 trivial lines. You could even write a little script, emacs macro or
- whatever to do it for you if you think it's so hard.
-
-
- > -optimize code only when you have a problem.
- > Why not anticipate the problem?
-
- Because premature "optimization" leads to unmaintainable code,
- and wastes effort that could have been put to better use.
-
-
- Jan Mattsson
-
-
-